package com.ywu.bpmn.flow.data;

import com.ywu.bpmn.flow.dto.YwuFlowInstanceCommonDto;
import com.ywu.bpmn.flow.dto.YwuFlowInstanceConditionDto;
import com.ywu.bpmn.flow.entity.YwuFlowInstanceEntity;
import com.ywu.bpmn.flow.entity.YwuFlowTaskEntity;
import com.ywu.bpmn.flow.vo.QueryFlowInstanceListVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface YwuFlowInstanceRepository {
    void insert(@Param("model")YwuFlowInstanceEntity entity);

    void updateFlowStatus(@Param("model")YwuFlowInstanceEntity entity);

    void updateFlowStatusAndCurrentNode(@Param("model")YwuFlowInstanceEntity entity);

    YwuFlowInstanceEntity getInstanceById(@Param("model")YwuFlowInstanceEntity entity);

    List<YwuFlowInstanceCommonDto> queryFlowTodoList(@Param("model") YwuFlowInstanceCommonDto entity);

    List<YwuFlowInstanceCommonDto> queryInstanceTodoList(@Param("model") YwuFlowInstanceCommonDto entity);

    YwuFlowInstanceCommonDto queryInstanceDetailInfo(@Param("model") YwuFlowInstanceCommonDto entity);

    void insertTask(@Param("model") YwuFlowTaskEntity ywuFlowTaskEntity);

    void updateTaskStatus(@Param("model") YwuFlowTaskEntity ywuFlowTaskEntity);

    void updateTaskResult(@Param("model") YwuFlowTaskEntity ywuFlowTaskEntity);

    void updateCurrentNode(@Param("model") YwuFlowInstanceEntity updateCurrentNode);

    YwuFlowTaskEntity getTaskInfoByInstanceIdAndAssignee(@Param("model") YwuFlowTaskEntity entity);

    List<YwuFlowTaskEntity> getTaskList(@Param("model") YwuFlowTaskEntity entity);

    YwuFlowInstanceCommonDto getInstanceAndFlowInfoByInstanceId(@Param("model") YwuFlowInstanceEntity searchInstance);

    List<YwuFlowInstanceCommonDto> queryFlowHistoryList(@Param("model") YwuFlowInstanceCommonDto dto);

    List<YwuFlowInstanceCommonDto> queryInstanceHistoryList(@Param("model") YwuFlowInstanceCommonDto dto);

    YwuFlowInstanceCommonDto queryHistoryInstanceDetailInfo(@Param("model") YwuFlowInstanceCommonDto dto);

    int queryFlowInstanceCount(@Param("model") YwuFlowInstanceConditionDto dto);

    List<QueryFlowInstanceListVo> queryFlowInstancePage(@Param("model") YwuFlowInstanceConditionDto dto);

    int queryInstanceCount(@Param("model") YwuFlowInstanceConditionDto dto);

    List<YwuFlowInstanceEntity> queryInstancePage(@Param("model") YwuFlowInstanceConditionDto dto);

    YwuFlowInstanceEntity getEntity(@Param("model") YwuFlowInstanceEntity entity);
}
